#ifndef OBJECTMODEL_H_
#define OBJECTMODEL_H_

#include <vector>
#include "modelGroup.h"
#include <GL/gl.h>


class ObjectModel {
	public:
		std::vector<float> _vertices;
		std::vector<float> _normals;
		std::vector<float> _textures;
		std::vector<ModelGroup*> _groups;
		std::map<std::string,Material*> _materials;

		GLenum type;

		unsigned int listid;
		bool listCreated;
	public:
		ObjectModel();
		virtual ~ObjectModel();

		unsigned int groupCount()const{ return _groups.size(); }
		const std::vector<ModelGroup*>& groups()const{ return _groups; }

		const std::vector<float>& vertices()const{ return _vertices; }
		const std::vector<float>& normals()const{ return _normals; }
		const std::vector<float>& textures()const{ return _textures; }
		Material& getMaterial(const std::string& name){ return *_materials[name]; }

		GLenum getType()const{ return type; }

		bool isDisplayListCreated(){ return this->listCreated; }
		void setDisplayListId(unsigned int id);
		unsigned int getDisplayListId(){ return this->listid; }
};

#endif /* OBJECTMODEL_H_ */
